<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:fmt="http://java.sun.com/jstl/fmt_rt"
          xmlns:c="http://java.sun.com/jstl/core_rt"
          xmlns:fn="http://java.sun.com/jsp/jstl/functions"
          xmlns="http://www.w3.org/1999/xhtml" version="2.0">

    <jsp:directive.attribute name="params" type="com.untrance.shop.common.vo.PagerParametersVO" 
    		rtexprvalue="true" required="false"/>
    <jsp:directive.attribute name="id" 
    		rtexprvalue="true" required="false"/>

	<c:if test="${!empty params and params.pagesCount > 1}">
		<c:set var="url" value="?${!empty id?'id=':''}${id}${!empty id?'&amp;':''}"/>
		<div class="pager">
		    <ul id="nav-pages">
		    	<c:if test="${params.currentPage != 1}">
		    		<li id='first_page'><a href="${url}page=1">←</a></li>
		    		
	   				<li id='previous_page'><a href="${url}page=${params.currentPage - 1}">←<![CDATA[&nbsp;]]>назад</a></li>
		    	</c:if>
		    	
		    	<c:forEach begin="${params.begin}" end="${params.end}" var="i">
					<![CDATA[&nbsp;]]>
		    		<c:choose>
		    			<c:when test="${params.currentPage != i}">
							<li><a href="${url}page=${i}">${i}</a></li>
		    			</c:when>
		    			<c:otherwise>
		    				<li><em>${i}</em></li>
		    			</c:otherwise>
		    		</c:choose>
		    	</c:forEach>
		    	
		    	<c:if test="${params.currentPage != params.pagesCount}">
		    		<li id='next_page'><a href="${url}page=${params.currentPage + 1}">вперед<![CDATA[&nbsp;]]>→</a></li>
					
					<li id='last_page'><a href="${url}page=${params.pagesCount}">→</a></li>
		    	</c:if>
			</ul>

			<div class="pager-found">Found ${params.totalResults} results</div>

			<div class="clearing"><jsp:text/></div>
		</div>
	</c:if>
</jsp:root>